package com.huilian.tool.douyin.applet.controller;

import com.alibaba.fastjson.JSONObject;
import com.huilian.tool.douyin.applet.service.DouYinAppletPayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * @author 少凡
 * date 2022/5/27 11:58
 * version 1.0
 */


@Slf4j
@Controller
@RequestMapping("/api/douyin/pay")
public class DouYinPayController {

    @Resource
    private DouYinAppletPayService douYinAppletPayService;

    /**
     * 支付回调
     *
     * @param jsonObject
     */
    @PostMapping("/notify")
    public String notify(@RequestBody JSONObject jsonObject) {
        return douYinAppletPayService.payNotify(jsonObject).toJSONString();
    }
}
